package org.example.service;


import org.example.dao.BookDao;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @Component注解如果不起名称，会有一个默认值就是当前类名首字母小写，所以也可以按照名称获取
 *  BookDaoService bookDaoService = (BookDaoService) ctx.getBean("bookDaoServiceImpl");
 * 交给Spring框架管理
 */
@Service
public class BookDaoServiceImpl implements BookDaoService{
    private BookDao bookDao;

    public void setBookDao(BookDao bookDao) {
        this.bookDao = bookDao;
    }

    public void save() {
        System.out.println("book service save ...");
        bookDao.save();
    }
}
